package com.athena.crm.service;

import com.athena.common.core.domain.model.LoginUser;
import com.athena.common.helper.LoginHelper;
import com.athena.crm.domain.CrmCustomer;
import com.athena.crm.domain.bo.CrmClueTransferBo;
import com.athena.crm.domain.bo.CrmClueTransferCustomerBo;
import com.athena.crm.domain.vo.CrmCustomerVo;
import com.athena.crm.domain.bo.CrmCustomerBo;
import com.athena.common.core.page.TableDataInfo;
import com.athena.common.core.domain.PageQuery;

import java.util.Collection;
import java.util.Date;
import java.util.List;

/**
 * CRM客户Service接口
 *
 * @author ruoyi
 * @date 2023-09-10
 */
public interface ICrmCustomerService {

    /**
     * 查询CRM客户
     */
    CrmCustomerVo queryById(Long id);

    /**
     * 查询CRM客户列表
     */
    TableDataInfo<CrmCustomerVo> queryPageList(LoginUser loginUser, CrmCustomerBo bo, PageQuery pageQuery);

    /**
     * 查询CRM客户列表
     */
    List<CrmCustomerVo> queryList(CrmCustomerBo bo);

    /**
     * 新增CRM客户
     */
    Boolean insertByBo(CrmCustomerBo bo);

    /**
     * 修改CRM客户
     */
    Boolean updateByBo(CrmCustomerBo bo);

    /**
     * 校验并批量删除CRM客户信息
     */
    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);

    /**
     * 线索转客户对象
     * @param bbo
     * @return
     */
    boolean insertByBbo(CrmClueTransferBo bbo);

    /**
     * 线索转客户
     * @param bo
     * @return
     */
    int clueTransferCustomer(CrmClueTransferCustomerBo bo);

    /**
     * 查重复客户（线索 -> 线索池）
     * @param name
     * @param phone
     * @return
     */
    CrmCustomerVo queryByNameAndPhone(String name, String phone);
}
